#include <iostream>
using namespace std;
#include <vector>

int main(int argc, const char *argv[]){
    vector<int> my_vect;
    // 尾插
    my_vect.push_back(10);
    my_vect.push_back(20);
    my_vect.push_back(30);
    my_vect.push_back(40);
    my_vect.push_back(50);
    // 使用迭代器遍历vector
    // 定义迭代器
    vector<int>::iterator my_iter;
    for(my_iter = my_vect.begin(); my_iter != my_vect.end(); my_iter++){
        cout << *my_iter << " ";
    }
    cout << endl;

    return 0;
}